//
//  UIButton+QLXExt.h
//  fcuhConsumer
//
//  Created by 邱良雄 on 15/8/7.
//  Copyright (c) 2015年 avatar. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef void (^ButtonActionClorce)(UIButton * sender);

@interface UIButton(CYExt)

@property (strong, nonatomic) UIColor *titleColor;
@property (strong, nonatomic) UIColor *highlightedTitleColor;
@property (strong, nonatomic) UIColor *selectedTitleColor;

@property (copy, nonatomic) NSString *title;
@property (copy, nonatomic) NSString *highlightedTitle;
@property (copy, nonatomic) NSString *selectedTitle;

@property (copy, nonatomic) NSString *image;
@property (copy, nonatomic) NSString *highlightedImage;
@property (copy, nonatomic) NSString *selectedImage;

@property (copy, nonatomic) NSString *bgImage;
@property (copy, nonatomic) NSString *highlightedBgImage;
@property (copy, nonatomic) NSString *selectedBgImage;


@property (strong, nonatomic) UIFont *titleFont;

- (void)addTarget:(id)target action:(SEL)action;

/*根据原生图片和按钮文字设置最真实的按钮大小**/
-(CGSize)realBtnSize;

/**交换按钮图片和文字的位置,并且设置间距*/
-(void)exchangeLocationLableImageTitleFont:(UIFont *)font magin:(float)magin;

/**扩充属性*/
@property (nonatomic, strong) NSString *imageBgName;

/**网络请求图片数据*/
- (void)setHeader:(NSString *)headerUrl;
- (void)setImageUrl:(NSString *)url;


/**------------------------------------------------------------------------------------*/

@property (nonatomic, strong) NSMutableArray * actionBlocks;

+(instancetype) createWithFrame:(CGRect) frame;
+(instancetype) create;

/**纯文字*/
+(instancetype) createWithText:(NSString *)text;
+(instancetype) createWithText:(NSString *)text color:(UIColor *)color font:(UIFont *) font;

/**文字+图片*/
+(instancetype) createWithText:(NSString *)text color:(UIColor *)color font:(UIFont *) font normal:(NSString *) normal;
+(instancetype) createWithText:(NSString *)text color:(UIColor *)color sldColor:(UIColor *)sldColor font:(UIFont *) font normal:(NSString *) normal;
+(instancetype) createWithText:(NSString *)text color:(UIColor *)color hldColor:(UIColor *)hldColor font:(UIFont *) font normal:(NSString *) normal highlighted:(NSString *)highlighted;
+(instancetype) createWithText:(NSString *)text color:(UIColor *)color sldColor:(UIColor *)sldColor font:(UIFont *) font normal:(NSString *) normal sld:(NSString *)sld;

/**纯图片*/
+(instancetype) createWithNormalBgImageStr:(NSString *)str;
+(instancetype) createWithNormalBgImageStr:(NSString *)str hightStr:(NSString *)hightStr;
+(instancetype) createWithNormalBgImageStr:(NSString *)str sldStr:(NSString *)sldStr;
/**纯图片 视觉小 事实上大*/
+(instancetype) createWithNormalImageStr:(NSString *)str;
+(instancetype) createWithNormalImageStr:(NSString *)str hightStr:(NSString *)hightStr;
+(instancetype) createWithNormalImageStr:(NSString *)str sldStr:(NSString *)sldStr;



-(void) addClickActionBlock:(ButtonActionClorce) block;

@end
